package org.jeecg.modules.innerApi.zhiYunSdApi.convert;

import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.common.util.MathUtil;
import org.jeecg.modules.innerApi.common.requestDto.*;
import org.jeecg.modules.innerApi.zhiYunSdApi.requestVo.*;
import org.jeecg.modules.xxgx.common.enums.*;
import org.jeecg.modules.xxgx.djgl.entity.tdyw.*;
import org.jeecg.modules.xxgx.djgl.enums.ZsfsEnum;
import org.jeecg.modules.xxgx.hzsqgl.entity.CsXxHzsqjsmx;
import org.jeecg.modules.xxgx.hzsqgl.vo.CsXxHzsqjsPage;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 智云数电请求参数转换
 */
public class ZySdRequestParamConvert {

    /**
     * 全电蓝票开具参数转换
     *
     * @param invoiceParam
     * @return
     */
    public static SdQdlpkjjkrc11Param invoiceParamConvert(InvoiceParam invoiceParam) {
        SdQdlpkjjkrc11Param param = new SdQdlpkjjkrc11Param();
        param.setFpqqlsh(invoiceParam.getFpsqlsh());
        param.setFplxdm(invoiceParam.getFplxdm());
        //转换发票类型代码
        if (FplxdmEnum.sdzp.getValue().equals(invoiceParam.getFplxdm()) && ZzfpbzEnum.N.getValue().equals(invoiceParam.getZzfpbz())) {
            param.setFplxdm(SdQdlpkjjkrc11Param.FplxdmEnum.qdfp_zzszyfp.getValue());
        } else if (FplxdmEnum.sdpp.getValue().equals(invoiceParam.getFplxdm()) && ZzfpbzEnum.N.getValue().equals(invoiceParam.getZzfpbz())) {
            param.setFplxdm(SdQdlpkjjkrc11Param.FplxdmEnum.qdfp_ptfp.getValue());
        } else if (FplxdmEnum.sdzp.getValue().equals(invoiceParam.getFplxdm()) && ZzfpbzEnum.Y.getValue().equals(invoiceParam.getZzfpbz())) {
            param.setFplxdm(SdQdlpkjjkrc11Param.FplxdmEnum.qdzzfp_zzszyfp.getValue());
        } else if (FplxdmEnum.sdpp.getValue().equals(invoiceParam.getFplxdm()) && ZzfpbzEnum.Y.getValue().equals(invoiceParam.getZzfpbz())) {
            param.setFplxdm(SdQdlpkjjkrc11Param.FplxdmEnum.qdzzfp_ptfp.getValue());
        } else {
            throw new JeecgBootException("发票类型暂不支持");
        }

        //特定要素类型转换待处理
        String tdyslxDm = convertTdyslxdm(invoiceParam);
        param.setTdyslxDm(tdyslxDm);//特定要素类型代码
        param.setKplx(invoiceParam.getKplx());//开票类型
        param.setXhdwsbh(invoiceParam.getXfsh());//销方识别号
        param.setXhdwmc(invoiceParam.getXfmc());//销方名称
        param.setXhdwdzdh(invoiceParam.getXfdzdh());//销方地址电话
        param.setXhdwyhzh(invoiceParam.getXfyhzh());//销方银行账户
        param.setGhdwsbh(invoiceParam.getKhsh());//购方税号
        param.setGhdwmc(invoiceParam.getKhmc());//购方名称
        param.setGhdwdzdh(invoiceParam.getKhdzdh());//购方地址电话
        param.setGhdwyhzh(invoiceParam.getKhyhzh());//购方银行账号

        param.setZsfs(SdQdlpkjjkrc11Param.zsfsEnum.convertValue(invoiceParam.getZsfs()));//征收方式
        param.setHjje(invoiceParam.getHjje().toPlainString());//合计金额
        param.setHjse(invoiceParam.getHjse().toPlainString());//合计税额
        param.setJshj(MathUtil.add(invoiceParam.getHjje(), invoiceParam.getHjse()).toPlainString());//价税合计
        param.setKce(invoiceParam.getKce() == null ? "" : invoiceParam.getKce().toPlainString());//扣除额
        param.setKpr(invoiceParam.getKpr());//开票人
        param.setSkr(invoiceParam.getSkr());//收款人
        param.setFhr(invoiceParam.getFhr());//复核人
        param.setGfkhdh(invoiceParam.getKhdh());//购方电话
        //param.setGfkhyx(invoiceParam.getKhlxyx());//购方邮箱 (注释不传，使用本地邮箱推送)

        //税率说明可用值（2，3）(税率说明（小规模纳税人开具 3 税率使用）前期已开具发票，发生销售折让、中止或者退回等情形需要开具红字发票，或者开票有误需要重新开具传 2，因为实际经营业务需要，放弃享受减按 1%征收率征收增值税政策传 3)
        param.setSlsm("");
        param.setBz(invoiceParam.getBz());//备注
        param.setGfzrrbs(invoiceParam.getGfzrrbs());//购方自然人标识
        param.setXfzrrbs("");//销方自然人标识可用值 N，Y（不传值为N）
        //确认购方信息是否存在(值为 1 是不确认购方信息可能会报（当前未查询到购 买方纳税人信息，请确认是否继续开具 ），默认是确认意思是不管购方信息是否真实存在都进行开具)
        param.setGfxxConfirm("");
        param.setSpflxConfirm("");//是否开启自然人校验(1：开启 空：不开启/继续开票)
        param.setSfzsgmfyhzh(invoiceParam.getSfzsgmfyhzh());//是否展示购方银行账号(是否展示购方银行账号到备注里面 y/Y 展示，其他否)
        param.setSfzsxsfyhzh(invoiceParam.getSfzsxsfyhzh());//是否展示销方银行账号(是否展示销方银行账号到备注里面 y/Y 展示，其他否)

        param.setZpFppzDm(invoiceParam.getZpfppzdm());//纸票票种代码
        param.setZzfpdm(invoiceParam.getZzfpdm());//纸质发票代码
        param.setZzfphm(invoiceParam.getZzfphm());//纸质发票号码

        if(TspzEnum.NCPSG.getValue().equals(invoiceParam.getTspz())) {
            param.setNcpsgzjlx(invoiceParam.getNcpsgzjlx());
        }

        //商品明细
        List<SdQdlpkjjkFyxm> fyxmList = new ArrayList<>();
        invoiceParam.getFpmxs().forEach(djmx -> {
            SdQdlpkjjkFyxm fyxm = new SdQdlpkjjkFyxm();
            fyxm.setFphxz(djmx.getFphxz());//发票行性质
            fyxm.setSpmc(djmx.getSpmc());//商品名称
            fyxm.setGgxh(djmx.getGgxh());//规格型号
            fyxm.setDw(djmx.getJldw());//单位
            fyxm.setSpsl(djmx.getSpsl() != null ? djmx.getSpsl().toPlainString() : "");//商品数量
            if (HsbzEnum.Y.getValue().equals(invoiceParam.getHsbz())) {
                fyxm.setDj(djmx.getHsdj() != null ? djmx.getHsdj().toPlainString() : "");
                fyxm.setJe(djmx.getHsje() != null ? djmx.getHsje().toPlainString() : "");
            } else {
                fyxm.setDj(djmx.getBhsdj() != null ? djmx.getBhsdj().toPlainString() : "");
                fyxm.setJe(djmx.getBhsje() != null ? djmx.getBhsje().toPlainString() : "");
            }
            fyxm.setSl(djmx.getTax() != null ? djmx.getTax().toPlainString() : "");//税率
            fyxm.setSe(djmx.getTaxje() != null ? djmx.getTaxje().toPlainString() : "");//税额
            fyxm.setHsbz(invoiceParam.getHsbz());//含税标志
            fyxm.setSpbm(djmx.getSpbm());//商品编码
            fyxm.setYhzcbs(djmx.getYhzcbs());//优惠政策标识
            fyxm.setLslbs(djmx.getLslbs());//零税率标识
            fyxm.setZzstsgl(djmx.getZzstsgl());//增值税特殊管理

            fyxmList.add(fyxm);
        });
        param.setFyxm(fyxmList);

        //特定业务
        if (TdyslxDmEnum.JZFW.getValue().equals(invoiceParam.getTdyslxdm())) {
            //建筑服务
            Jzfw jzfw = invoiceParam.getTdywJzfw();
            if (jzfw == null) {
                throw new JeecgBootException("特定业务建筑服务信息为空");
            }
            param.setFwfsd(jzfw.getJzfwfsd());//服务发生地
            param.setFullAddress(jzfw.getJzfwfsdxxdz());//服务发生地详细地址
            param.setKdsbz(jzfw.getKdsbz());//跨地（市）标志
            param.setTdzzsxmbh(jzfw.getTdzzsxmbh());//土地增值税项目编号
            param.setJzxmmc(jzfw.getJzxmmc());//建筑项目名称
        }
        if (TdyslxDmEnum.HWYSFW.getValue().equals(invoiceParam.getTdyslxdm())) {
            List<Hwysfwmx> hwysfwList = invoiceParam.getTdywHwysfwList();
            if (hwysfwList == null || hwysfwList.size() == 0) {
                throw new JeecgBootException("特定业务：货物运输服务内容为空！");
            }

            List<SdQdlpkjjkHwys> sdQdlpkjjkHwysList = new ArrayList<>();
            hwysfwList.forEach(hwysmx -> {
                SdQdlpkjjkHwys sdQdlpkjjkHwys = new SdQdlpkjjkHwys();
                sdQdlpkjjkHwys.setYsgjzl(hwysmx.getYsgjzl());//运输工具种类
                sdQdlpkjjkHwys.setYsgjhp(hwysmx.getYsgjhp());//运输工具牌号
                sdQdlpkjjkHwys.setYshwmc(hwysmx.getYshwmc());//运输货物名称
                sdQdlpkjjkHwys.setQyd(hwysmx.getQyd());//出发地
                sdQdlpkjjkHwys.setDdd(hwysmx.getDdd());//到达地
            });

            param.setHwys(sdQdlpkjjkHwysList);
        }

        if (TdyslxDmEnum.BDCXS.getValue().equals(invoiceParam.getTdyslxdm())) {
            //不动产销售
            Bdcxsfw bdcxsfw = invoiceParam.getTdywBdcxs();
            if (bdcxsfw == null) {
                throw new JeecgBootException("特定业务:不动产销售信息为空");
            }
            param.setWqhtbabh(bdcxsfw.getWqhtbah());//网签合同备案编号
            param.setFwfsd(bdcxsfw.getBdcdz());//不动产地址
            param.setFullAddress(bdcxsfw.getBdcdzxxdz());//不动产详细地址
            param.setKdsbz(bdcxsfw.getKdsbz());//跨地市标识
            param.setTdzzsxmbh(bdcxsfw.getTdzzsxmbh());//土地增值税项目编号
            param.setHdjsjg(bdcxsfw.getHdjsjg());//核定计税价格
            param.setSjcjhsje(bdcxsfw.getSjcjhsje());//实际成交含税金额
            param.setCqzsh(bdcxsfw.getCqzsh());//产权证书号
            param.setDw(bdcxsfw.getDw());//单位
        }

        if (TdyslxDmEnum.BDCJYZLFW.getValue().equals(invoiceParam.getTdyslxdm())) {
            //不动产经营租赁服务
            Bdcjyzlfw bdcjyzlfw = invoiceParam.getTdywBdcjyzlfw();
            if (bdcjyzlfw == null) {
                throw new JeecgBootException("特定业务:不动产经营租赁服务信息为空");
            }
            param.setFwfsd(bdcjyzlfw.getBdcdz());//不动产地址
            param.setFullAddress(bdcjyzlfw.getBdcdzxxdz());//不动产详细地址
            param.setZlrqq(DateUtils.formatDate(bdcjyzlfw.getZlrqq()));//租赁日期起
            param.setZlrqz(DateUtils.formatDate(bdcjyzlfw.getZlrqz()));//租赁日期止
            param.setKdsbz(bdcjyzlfw.getKdsbz());//跨地市标识
            param.setCqzsh(bdcjyzlfw.getCqzsh());//产权证书号
            param.setDw(bdcjyzlfw.getDw());//单位
        }
        if (TdyslxDmEnum.LKYSFW.getValue().equals(invoiceParam.getTdyslxdm())) {
            //旅客运输服务
            List<Lkysfwmx> lkysfwmxList = invoiceParam.getTdywLkysfwList();
            if (lkysfwmxList == null || lkysfwmxList.size() == 0) {
                throw new JeecgBootException("特定业务：旅客运输服务内容为空！");
            }

            List<SdQdlpkjjkHwys> sdQdlpkjjkHwysList = new ArrayList<>();
            lkysfwmxList.forEach(lkysfwmx -> {
                SdQdlpkjjkHwys sdQdlpkjjkHwys = new SdQdlpkjjkHwys();
                sdQdlpkjjkHwys.setCxr(lkysfwmx.getCxr());//出行人
                sdQdlpkjjkHwys.setCxrq(DateUtils.dateformat(lkysfwmx.getCxrq(), "yyyy-MM-dd"));//出行日期
                sdQdlpkjjkHwys.setSfzjlx(lkysfwmx.getSfzjlx());//身份证件类型
                sdQdlpkjjkHwys.setSfzjhm(lkysfwmx.getSfzjhm());//身份证件类型
                sdQdlpkjjkHwys.setJtgjlx(lkysfwmx.getJtgjlx());//交通工具类型
                sdQdlpkjjkHwys.setDengj(lkysfwmx.getDengj());//交通工具等级
            });

            param.setHwys(sdQdlpkjjkHwysList);
        }

        //差额征收
        if (!ZsfsEnum.PTZS.getValue().equals(invoiceParam.getZsfs())) {
            List<SdQdlpkjjkCepz> cezsList = new ArrayList<>();
            invoiceParam.getCezsList().forEach(cezsmx -> {
                SdQdlpkjjkCepz czpz = new SdQdlpkjjkCepz();
                BeanUtils.copyProperties(cezsmx, czpz);
                cezsList.add(czpz);
            });
            param.setCepz(cezsList);
        }

        //附加要素
        if (invoiceParam.getFjysList() != null && invoiceParam.getFjysList().size() > 0) {
            List<SdQdlpkjjkFjys> fjysList = new ArrayList<>();
            invoiceParam.getFjysList().forEach(fjysVO -> {
                SdQdlpkjjkFjys fjys = new SdQdlpkjjkFjys();
                fjys.setUuid(fjysVO.getFjysuuid());
                fjys.setFjysz(fjysVO.getFjysz());
                fjysList.add(fjys);
            });
            param.setFjys(fjysList);
        }
        return param;
    }

    /**
     * 登录电票平台参数转换
     *
     * @param dpdlParam
     * @return
     */
    public static SdDldpptrc118Param dpdlParamConvert(DpdlParam dpdlParam) {
        SdDldpptrc118Param param = new SdDldpptrc118Param();
        BeanUtils.copyProperties(dpdlParam, param);
        return param;
    }

    /**
     * 红字信息表申请参数转换
     *
     * @param page
     * @return
     */
    public static SdSqqdphzxxbrc13Param sdSqqdphzxxbrc13ParamConvert(CsXxHzsqjsPage page) {
        SdSqqdphzxxbrc13Param sqqdphzxxbrc13Param = new SdSqqdphzxxbrc13Param();
        sqqdphzxxbrc13Param.setXhdwsbh(page.getXfsh());
        sqqdphzxxbrc13Param.setYfphm(page.getYfphm());
        sqqdphzxxbrc13Param.setChyydm(page.getHcyy());
        String sqf = page.getSqf();
        //2：销方全额红冲申请3: 购方全额红冲
        if (sqf.startsWith("0")) {
            sqqdphzxxbrc13Param.setSqyy("3");
        } else {
            sqqdphzxxbrc13Param.setSqyy("2");
        }
        if (sqf.startsWith("0")) {
            if (page.getYkprq() != null) {
                sqqdphzxxbrc13Param.setKprq(DateUtils.date2Str(page.getYkprq(), DateUtils.datetimeFormat.get()));
            }
            sqqdphzxxbrc13Param.setNsrsbh(page.getXfsh());
            sqqdphzxxbrc13Param.setTdyslxDm(page.getTdyslxdm());
        }
        if ("1".equals(page.getHclx())) {
            //部分红冲
            sqqdphzxxbrc13Param.setBfch("1");
            sqqdphzxxbrc13Param.setHjje(page.getHjje());
            sqqdphzxxbrc13Param.setHjse(page.getHjse());
            List<CsXxHzsqjsmx> csXxHzsqjsmxList = page.getCsXxHzsqjsmxList();
            List<SdSqqdphzxxbrc13Param.SdSqqdphzxxbrc13MxParam> list = new ArrayList<>();
            for (CsXxHzsqjsmx csXxHzsqjsmx : csXxHzsqjsmxList) {
                SdSqqdphzxxbrc13Param.SdSqqdphzxxbrc13MxParam param = new SdSqqdphzxxbrc13Param.SdSqqdphzxxbrc13MxParam();
                param.setXh(csXxHzsqjsmx.getMxhh());
                param.setJe(csXxHzsqjsmx.getBhsje());
                param.setSe(csXxHzsqjsmx.getTaxje());
                param.setSpsl(csXxHzsqjsmx.getSpsl());
                list.add(param);
            }
            sqqdphzxxbrc13Param.setFyxm(list);
        }
        sqqdphzxxbrc13Param.setYfpdm(page.getYfpdm());
        sqqdphzxxbrc13Param.setFplxdm(page.getYfplxdm());
        return sqqdphzxxbrc13Param;
    }

    /**
     * 红字信息表撤销参数转换
     *
     * @param param
     * @return
     */
    public static SdCxhzxxbrc113Param sdCxhzxxbrc113ParamConvert(HzxxbcxParam param) {
        SdCxhzxxbrc113Param cxhzxxbrc113Param = new SdCxhzxxbrc113Param();
        BeanUtils.copyProperties(param, cxhzxxbrc113Param);
        cxhzxxbrc113Param.setNsrsbh(param.getNsrsbh());
        cxhzxxbrc113Param.setXxbbh(param.getHzxxbbh());
        return cxhzxxbrc113Param;
    }

    /**
     * 红字信息表同步参数转换
     *
     * @param param
     * @return
     */
    public static SdHzxxbtbrc114Param sdHzxxbtbrc114ParamConvert(HzxxbtbParam param) {
        SdHzxxbtbrc114Param sdHzxxbtbrc114Param = new SdHzxxbtbrc114Param();
        BeanUtils.copyProperties(param, sdHzxxbtbrc114Param);
        sdHzxxbtbrc114Param.setNsrsbh(param.getNsrsbh());
        //转换日期格式
        sdHzxxbtbrc114Param.setKprqq(DateUtils.fromStrToStr(param.getSqrqq(), DateUtils.date_sdf.get(), DateUtils.yyyyMMdd.get()));
        sdHzxxbtbrc114Param.setKprqz(DateUtils.fromStrToStr(param.getSqrqz(), DateUtils.date_sdf.get(), DateUtils.yyyyMMdd.get()));
        return sdHzxxbtbrc114Param;
    }

    /**
     * 红字信息表查询参数转换
     *
     * @param param
     * @return
     */
    public static SdCxhzxxbrc112Param sdCxhzxxbrc112ParamConvert(HzxxbtbParam param) {
        SdCxhzxxbrc112Param sdCxhzxxbrc112Param = new SdCxhzxxbrc112Param();
        BeanUtils.copyProperties(param, sdCxhzxxbrc112Param);
        sdCxhzxxbrc112Param.setNsrsbh(param.getNsrsbh());
        //转换日期格式
        sdCxhzxxbrc112Param.setKprqq(DateUtils.fromStrToStr(param.getSqrqq(), DateUtils.date_sdf.get(), DateUtils.yyyyMMdd.get()));
        sdCxhzxxbrc112Param.setKprqz(DateUtils.fromStrToStr(param.getSqrqz(), DateUtils.date_sdf.get(), DateUtils.yyyyMMdd.get()));
        return sdCxhzxxbrc112Param;
    }

    /**
     * 全电票开负数发票参数转换
     *
     * @param param
     * @return
     */
    public static SdQdpkfsfprc14Param sdQdpkfsfprc14ParamConvert(HzfpkjParam param) {
        SdQdpkfsfprc14Param sdQdpkfsfprc14Param = new SdQdpkfsfprc14Param();
        BeanUtils.copyProperties(param, sdQdpkfsfprc14Param);
        return sdQdpkfsfprc14Param;
    }

    /**
     * 发票开具参数转换为负数发票开具参数
     *
     * @param invoiceParam
     * @return
     */
    public static HzfpkjParam hzfpkjParamConvert(InvoiceParam invoiceParam) {
        HzfpkjParam hzfpkjParam = new HzfpkjParam();
        hzfpkjParam.setFpqqlsh(invoiceParam.getFpsqlsh());
        hzfpkjParam.setXhdwsbh(invoiceParam.getXfsh());
        hzfpkjParam.setXhdwdzdh(invoiceParam.getXfdzdh());
        hzfpkjParam.setXhdwyhzh(invoiceParam.getXfyhzh());
        hzfpkjParam.setGhdwsbh(invoiceParam.getKhsh());
        hzfpkjParam.setGhdwmc(invoiceParam.getKhmc());
        hzfpkjParam.setGhdwdzdh(invoiceParam.getKhdzdh());
        hzfpkjParam.setGhdwyhzh(invoiceParam.getKhyhzh());
        hzfpkjParam.setKpr(invoiceParam.getKpr());
        hzfpkjParam.setTzdbh(invoiceParam.getHzxxbbh());
        hzfpkjParam.setYfphm(invoiceParam.getYfphm());

        hzfpkjParam.setFwqxx(invoiceParam.getFwqxx());
        hzfpkjParam.setKpzd(invoiceParam.getKpzd());
        hzfpkjParam.setQyxx(invoiceParam.getQyxx());

        //特定要素类型代码转换
        String tdyslxDm = convertTdyslxdm(invoiceParam);
        hzfpkjParam.setTdyslxDm(tdyslxDm);//特定要素类型代码
        hzfpkjParam.setBz(invoiceParam.getBz());
        hzfpkjParam.setYfpdm(invoiceParam.getYfpdm());
        return hzfpkjParam;
    }

    /**
     * 全电票开负数发票参数转换
     *
     * @param param
     * @return
     */
    public static SdHqbswjrc15Param sdQdpkfsfprc14ParamConvert(QdbsxzParam param) {
        SdHqbswjrc15Param sdHqbswjrc15Param = new SdHqbswjrc15Param();
        BeanUtils.copyProperties(param, sdHqbswjrc15Param);
        return sdHqbswjrc15Param;
    }

    /**
     * 查询可修复发票
     * @param param
     * @return
     */
    public static SdCxkxfdfpsjrc121Param sdCxkxfdfpsjrc121ParamConvert(FpxfParam param) {
        SdCxkxfdfpsjrc121Param sdCxkxfdfpsjrc121Param = new SdCxkxfdfpsjrc121Param();
        BeanUtils.copyProperties(param, sdCxkxfdfpsjrc121Param);
        return sdCxkxfdfpsjrc121Param;
    }

    /**
     * 根据系统中特殊票种和特定业务转换为智云接口需要的特定要素类型代码
     *
     * @param invoiceParam
     * @return
     */
    private static String convertTdyslxdm(InvoiceParam invoiceParam) {
        String tdyslxdm = "";
        if (TspzEnum.NCPXS.getValue().equals(invoiceParam.getTspz())) {
            tdyslxdm = SdQdlpkjjkrc11Param.tdyslxDmEnum.zcncpxsfp.getValue();
        } else if (TspzEnum.NCPSG.getValue().equals(invoiceParam.getTspz())) {
            tdyslxdm = SdQdlpkjjkrc11Param.tdyslxDmEnum.ncpsgfp.getValue();
        } else if (TspzEnum.ZKTXF.getValue().equals(invoiceParam.getTspz())) {
            tdyslxdm = SdQdlpkjjkrc11Param.tdyslxDmEnum.txf.getValue();
        } else if (TspzEnum.QTTXF.getValue().equals(invoiceParam.getTspz())) {
            tdyslxdm = SdQdlpkjjkrc11Param.tdyslxDmEnum.txf.getValue();
        } else if (TspzEnum.CPYXS.getValue().equals(invoiceParam.getTspz())) {
            tdyslxdm = SdQdlpkjjkrc11Param.tdyslxDmEnum.cpyfp.getValue();
        } else if (TspzEnum.JDC.getValue().equals(invoiceParam.getTspz())) {
            tdyslxdm = SdQdlpkjjkrc11Param.tdyslxDmEnum.jdc.getValue();
        } else if (TdyslxDmEnum.JZFW.getValue().equals(invoiceParam.getTdyslxdm())) {
            tdyslxdm = SdQdlpkjjkrc11Param.tdyslxDmEnum.jzfwfp.getValue();
        } else if (TdyslxDmEnum.HWYSFW.getValue().equals(invoiceParam.getTdyslxdm())) {
            tdyslxdm = SdQdlpkjjkrc11Param.tdyslxDmEnum.hwysfwfp.getValue();
        } else if (TdyslxDmEnum.BDCXS.getValue().equals(invoiceParam.getTdyslxdm())) {
            tdyslxdm = SdQdlpkjjkrc11Param.tdyslxDmEnum.bdcxsfwfp.getValue();
        } else if (TdyslxDmEnum.BDCJYZLFW.getValue().equals(invoiceParam.getTdyslxdm())) {
            tdyslxdm = SdQdlpkjjkrc11Param.tdyslxDmEnum.bdcjyzlfw.getValue();
        } else if (TdyslxDmEnum.LKYSFW.getValue().equals(invoiceParam.getTdyslxdm())) {
            tdyslxdm = SdQdlpkjjkrc11Param.tdyslxDmEnum.lkysfwfp.getValue();
        }
        return tdyslxdm;
    }
}
